//
//  MoreViewController.swift
//  HiBook
//
//  Created by Apple on 16/7/27.
//  Copyright © 2016年 Apple. All rights reserved.
//

import UIKit
import WebKit

class MoreViewController: CommonViewController,WKNavigationDelegate,WKUIDelegate,WKScriptMessageHandler{

    var moreWebView : WKWebView?
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.title = "更多"

        
        let config = WKWebViewConfiguration()
        
        self.moreWebView = WKWebView(frame: self.view.frame ,configuration: config)
        
        self.moreWebView?.UIDelegate = self
        
        self.moreWebView?.navigationDelegate = self
        
        self.moreWebView?.configuration.userContentController.addScriptMessageHandler(self, name: "responesToPhone")
        
        self.moreWebView?.allowsBackForwardNavigationGestures = true
        
        self.moreWebView?.scrollView.scrollEnabled = false 
        
        let request = NSURLRequest(URL: NSURL(string: "http://\(MAIN_IP):8000/web/setting.html")!)
        
        self.moreWebView?.loadRequest(request)
        
        self.view.addSubview(moreWebView!)

    }


    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    func userContentController(userContentController: WKUserContentController, didReceiveScriptMessage message: WKScriptMessage) {
        
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

    
}
